[assembly: System.Web.UI.WebResource("BM.Tools.WebControls.MForm.Controls.Menu.TabButtons.js", "application/x-javascript")]
[assembly: System.Web.UI.WebResource("BM.Tools.WebControls.MForm.Controls.Menu.TabButtons.debug.js", "application/x-javascript")]

namespace BM.Tools.WebControls.MForm.Controls.Menu
{
    using System.ComponentModel;
    using System.Web.UI;

    using AjaxControlToolkit;

    using BM.Tools.WebControls.MForm.Controls.Helper;

    /// <summary>
    /// This control keeps shows appropriate buttons for the currently active item of the MForm tree
    /// </summary>
    [ClientScriptResource("BM.Tools.WebControls.MForm", "BM.Tools.WebControls.MForm.Controls.Menu.TabButtons.js")]
    public class TabButtons : MenuContainer
    {
        private bool countEmptyContainers = true;

        private int depth = 2;

        /// <summary>
        /// Gets or sets a value indicating whether to count empty containers.
        /// </summary>
        /// <value>
        /// The count empty containers.
        /// </value>
        [DefaultValue(true)]
        [AttributeProperty(Name = "countEmptyContainers")]
        public bool CountEmptyContainers
        {
            get
            {
                return countEmptyContainers;
            }

            set
            {
                countEmptyContainers = value;
            }
        }

        /// <summary>
        /// Gets or sets Depth.
        /// </summary>
        /// <value>
        /// The depth.
        /// </value>
        [DefaultValue(2)]
        [AttributeProperty(Name = "depth")]
        public int Depth
        {
            get
            {
                return depth;
            }

            set
            {
                depth = value;
            }
        }

        /// <summary>
        /// Gets or sets ID.
        /// </summary>
        /// <value>
        /// The control id.
        /// </value>
        public override string ID
        {
            get
            {
                return "TabMenu";
            }

            set
            {
                base.ID = value;
            }
        }

        /// <summary>
        /// Adds custom attributes to the control
        /// </summary>
        /// <param name="writer">
        /// The writer.
        /// </param>
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            this.AddAttributesFromProperties(writer);
            base.AddAttributesToRender(writer);
        }
    }
}